home *** CD-ROM | disk | FTP | other *** search
/ .net 2000 August / NET74.ISO / pc / Software / JavaApplet / AnfyMacBeta1.sea / Anfy for Macintosh / anjavapp / anfy3d / anfy3d.txt < prev    next >
Encoding:
Text File  |  1999-07-05  |  17.1 KB  |  449 lines  |  [TEXT/ttxt]

  1.  
  2.        Anfy 3d Light - Copyright (C) by F. Ciucci & A. Fasce 1998/99
  3.  
  4.  
  5. INTRODUCTION.
  6.  
  7. This applet animate 3D scenes in realtime with shading, texture mapping,
  8. transparency, motion blur, and fog effects.
  9.  
  10. Anfy 3D is a series of applets which work together with 3D Studio Max
  11. plugin to visualise Max's 3D scenes. We provide Anfy 3D full version at our
  12. site: 
  13.  
  14. http://www.anfyteam.com/panfy3d.html 
  15.  
  16. You need this full version in order to import your original objects. For
  17. 3D novices, we have provided ready-made objects (sphere, cone, waving sheet, 
  18. labyrinth) in this version. So, you can manipulate these objects without
  19. need of 3D modelling skills.
  20.  
  21. NOTE:
  22.  
  23. If you are interested in professional 3D visualisation, check out the
  24. Anfy 3D Full version. Even if you are non 3D specialist, we can produce 3D
  25. scenes for you. This may include 3D company logos, banners, etc.
  26.  
  27. **************************************************************************
  28.  
  29. NECESSARY FILES.
  30.  
  31. Apart from texture images you specify, you need to upload the following
  32. .class files. 
  33.  
  34. For Anfy 3D rendering engine:
  35.  
  36. anfy3d.class
  37. anfy3ds0.class
  38. anfy3ds1.class
  39. Lware.class
  40. anfy.class
  41.  
  42. For objects:
  43.  
  44. Box01.class
  45. Cone01.class
  46. Sphere01.class
  47. Sphere02.class
  48.  
  49. Optionally, you may want to upload anfy3d.jar for speedy loading on 
  50. recent browsers. 
  51.  
  52. NOTE:
  53.  
  54. You must always upload .class files, even if you choose to use .jar file.
  55. Otherwise, visitors who use old browsers can't see the applet.
  56.  
  57. **************************************************************************
  58.  
  59. EXAMPLE.
  60.  
  61. Insert the <applet></applet> tag in your html document as follows to add 
  62. the applet to your page (Comments after semicolon ";" are code explanations
  63.  and acceptable values. They are not part of the applet language):
  64.  
  65. <applet archive="anfy3d.jar" code="anfy3d.class" width="320" height="200">
  66. <param name="credits" value="Applet by Andrea Fasce (www.anfyteam.com)">
  67. <param name="regcode" value="NO">         ; Registration code (For registered users)
  68. <param name="reglink" value="NO">         ; Optional URL link when the applet
  69.                                           is "clicked".
  70. <param name="regnewframe" value="YES">      ; Linked page opened in new frame?
  71. <param name="regframename" value="_blank">  ; Name of new frame for the link
  72. <param name="statusmsg" value="Anfy 3d applet"> ; Statusbar message
  73. <param name="real_width" value="320">         ; Internal calculation width
  74. <param name="real_height" value="200">        ; Internal calculation height
  75. <param name="texture0" value="texture.gif">  ; Texture 0 (GIF image 128x128)
  76. <param name="texture1" value="fire.gif">     ; Texture 1 (GIF image 128x128)
  77. <param name="texture2" value="texture2.gif"> ; Texture 2 (GIF image 128x128)
  78. <param name="phongmap" value="light2.gif">   ; Phong light (GIF image 128x128)
  79. <param name="gaussmap" value="light.gif">    ; Gphong light (GIF image 128x128)
  80. <param name="interactive" value="NO">        ; Interactive mode ("YES", "NO")
  81. <param name="script" value="0">           ; Script (0 .. 1) 0 = OFF
  82. <param name="shadow" value="0">           ; Shadow (0 .. 2) 0 = OFF
  83. <param name="mirror" value="1">           ; Mirror (0 .. 1) 0 = OFFa
  84. <param name="lightballs" value="6">       ; Light balls (0 .. 6)
  85. <param name="main_type" value="1">        ; Main object (0 .. 2)
  86. <param name="main_render" value="2">      ; Main render (0 .. 14)
  87. <param name="main_texture" value="0">     ; Main texture (0 .. 2)
  88. <param name="rot_x" value="0.1">          ; X rotation (0.0 .. 2.0)
  89. <param name="rot_y" value="0.07">         ; Y rotation (0.0 .. 2.0)
  90. <param name="rot_z" value="0.04">         ; Z rotation (0.0 .. 2.0)
  91. <param name="sheet_x" value="100">        ; Sheet height
  92. <param name="sheet_y" value="100">        ; Sheet width
  93. <param name="sheet_numx" value="10">      ; Sheet height faces subdivisions
  94. <param name="sheet_numy" value="10">      ; Sheet width faces subdivisions
  95. <param name="sheet_add" value="0.2">      ; Sheet anim add (0 .. 3.14)
  96. <param name="sheet_h" value="28">         ; Sheet waving amplitude
  97. <param name="sheet_period1" value="6.28"> ; Sheet period for height sine
  98. <param name="sheet_period2" value="6.28"> ; Sheet period for width sine
  99. <param name="sheet_function" value="2">   ; Sheet waving function (0 .. 2)
  100. <param name="animlight" value="NO">     ; Anim light in script 1 ("YES", "NO")
  101. <param name="child_type" value="2">     ; Child objects (0 .. 3)
  102. <param name="child_render" value="4">   ; Child render (0 .. 14)
  103. <param name="child_texture" value="1">  ; Child texture (0 .. 2)
  104. <param name="back_type" value="1">      ; Background type (0 .. 2)
  105. <param name="back_render" value="7">    ; Background render (0 .. 14)
  106. <param name="back_texture" value="2">   ; Background texture (0 .. 2)
  107. <param name="back_r" value="50">        ; Background colour red component
  108. <param name="back_g" value="30">        ; Background colour green component
  109. <param name="back_b" value="0">         ; Background colour blue component
  110. <param name="fog" value="0">            ; Fog (0 .. 1)
  111. <param name="fog_near" value="300">     ; Fog distance start (0 .. 1000)
  112. <param name="fog_far" value="340">      ; Fog distance stop (0 .. 1000)
  113. <param name="blur_motion" value="0">    ; Motion blur (0 .. 1)
  114. <param name="overimg" value="NO">        ; Optional image over applet
  115. <param name="overimgX" value="0">        ; X position of overlay image
  116. <param name="overimgY" value="0">        ; Y position of overlay image
  117. <param name="memdelay" value="1000">      ; Memory de-allocation delay
  118. <param name="priority" value="3">         ; Task priority (1..10)
  119. <param name="MinSYNC" value="10">         ; Min. milliseconds/frame for sync
  120. Sorry, your browser doesn't support Java.  ; Message for non Java browsers.
  121. </applet>                                  ; End of applet tag
  122.  
  123.  
  124. ****************************************************************
  125.  
  126. PARAMETER DESCRIPTIONS
  127.  
  128.  
  129. The following instructions describe the meaning of the available 
  130. parameters for this applet:
  131.  
  132. [Specify the applet and its size]
  133.  
  134. <applet archive="anfy3d.jar" code="anfy3d.class" width="320" height="200">
  135.  
  136. Here, you specify the applet name and its width and height in pixels.
  137. Since, this applet distinguishes the internally calculated image size (ICIS)
  138. and the actually output image size (OIS), you may want to set the internal
  139.  size smaller than the output size.
  140.  
  141. <param name="real_width" value="320">       ; Internal calculation width
  142. <param name="real_height" value="200">      ; Internal calculation height
  143.  
  144. In this example, ICIS = OIS. If you choose to set ICIS < OIS, the result 
  145. is an expanded image. This reduces the required calculation.
  146.  
  147. [Credit parameter]
  148.  
  149. <param name="credits" value="Applet by Andrea Fasce (www.anfyteam.com)">
  150.  
  151. Attempting to change the credit parameter will disable the applet.
  152.  
  153. [Registration parameters]
  154.  
  155. <param name="regcode" value="NO">         ; Registration code 
  156.  
  157. To activate the reg parameters, read the shareware registration notes.
  158. In the "regcode" parameter, place the registration code you purchased 
  159. from us. If the code is correct and the applet is run from the registered
  160.  domain name, "link" parameters will be enabled and the applet will be
  161. linked to an associated URL when it mouse-clicked.
  162.  
  163. <param name="reglink" value="NO">         ; Optional URL link
  164. <param name="regnewframe" value="YES">      ; Linked page opened in new frame?
  165.  
  166. If you set "regnewframe" to "YES", you can specify a specific frame location
  167. for the reglink:
  168.  
  169. "_blank"  : To load the link in a new blank unnamed browser window.
  170. "_self"   : To load the link into the same window the applet occupies.
  171. "_parent" : To load the link into the immediate parent frame.
  172. "_top"    : To load the link into the top body of the window.
  173.  
  174. <param name="regframename" value="_blank">  ; Name of new frame for the link
  175.  
  176. You can also set a custom frame name, such as "mainpage".
  177.  
  178. <param name="statusmsg" value="Anfy 3d applet"> ; Statusbar message
  179.  
  180. Here, you set the statusbar message, which is displayed at the bottom
  181. of a browser window, when you mouse-over the applet.
  182.  
  183. [Textures]
  184.  
  185. <param name="real_width" value="320">        ; Internal calculation width
  186. <param name="real_height" value="200">       ; Internal calculation height
  187. <param name="texture0" value="texture.gif">  ; Texture 0 (GIF image 128x128)
  188. <param name="texture1" value="fire.gif">     ; Texture 1 (GIF image 128x128)
  189. <param name="texture2" value="texture2.gif"> ; Texture 2 (GIF image 128x128)
  190. <param name="phongmap" value="light2.gif">  ; Phong light (GIF image 128x128)
  191. <param name="gaussmap" value="light.gif">   ; Gphong light (GIF image 128x128)
  192.  
  193. Each of "texture0", "texture1", "texture2", "phongmap", "gaussmap" must 
  194. address a 64x64 or 128x128 GIF image. No other sizes or image formats are 
  195. accepted.
  196.  
  197. "texture0", "texture1", "texture2" are general use texture maps.
  198. If you need only one texture, use "texture0" and delete parameters "texture1"
  199. and "texture2", so these textures won't be loaded. If you need 2 textures, 
  200. use "texture0" and "texture1". If you need 3 textures, use "texture0", 
  201. "texture1" and "texture2".
  202.  
  203. "phongmap" is a special texture used to obtain realtime phong rendering.
  204. If you don't use phong rendering, delete this parameter and the texture 
  205. won't be loaded.
  206.  
  207. NOTE: If you enable lightballs, this phongmap texture is required, even if
  208.  phong rendering isn't selected.
  209.  
  210. "gaussmap" is a special texture used to obtain Gaussian phong rendering.
  211. If you don't use it, just delete this parameter.
  212.  
  213. [Interactive mode]
  214.  
  215. <param name="interactive" value="NO">       ; Interactive mode ("YES", "NO")
  216.  
  217. If you set "interactive" parameter to "YES", the objects rotation can be
  218. controlled with a mouse pointer.
  219.  
  220. [Select a Script]
  221.  
  222. The most important parameter is "script": with a value of "0" you choose the
  223. script 0, with a value of "1" you choose the script 1.
  224.  
  225. Each script has its own corresponding parameters:
  226.  
  227.  
  228. ------------------------------
  229. - SCRIPT 0: ROTATING OBJECTS -
  230. ------------------------------
  231.  
  232. You can choose the main object with "main_type" parameter as follows:
  233.  
  234. main_type :
  235.  
  236.  0  sphere    (require sphere01.class)
  237.  1  sheet
  238.  2  cone      (require cone01.class)
  239.  
  240.  
  241. Like background object, we have:
  242.  
  243. main_render:  render technique (0 .. 14)
  244. main_texture: texture for main object (0 = texture0, 1 = texture1 etc.)
  245.  
  246.  0  Plain texture
  247.  1  Gouraud shading
  248.  2  Phong shading          ** NOTE: "phongmap" must be loaded
  249.  3  Gaussian phong shading ** NOTE: "gaussmap" must be loaded
  250.  4  Transparent (light)
  251.  5  Transparent (medium)
  252.  6  Liquid texture
  253.  7  Liquid gouraud shading
  254.  8  Liquid phong shading    ** NOTE: "phongmap" must be loaded
  255.  9  Liquid transparent
  256.  10 Reflects mirror view    ** NOTE: texture is ignored, a mirror must exists
  257.  11 Particles               ** NOTE: texture is ignored
  258.  12 Darker plain texture
  259.  13 Metal shading           ** NOTE: "phongmap" must be loaded
  260.  14 Environment mapping
  261.  
  262.  
  263. If you have selected the sheet object, here are the sheet parameters:
  264.  
  265. sheet_x    :       Height
  266. sheet_y    :       Width
  267. sheet_numx:     Number of height faces subdivisions
  268. sheet_numy:     Number of width faces subdivisions
  269. sheet_add:      Value to add for anim (0 .. 3.14)
  270. sheet_h:        Amplitude of waves
  271. sheet_period1:  Period for height sine, in radiants (3.14 = 1 period)
  272. sheet_period2:  Period for width sine, in radiants (3.14 = 1 period)
  273. sheet_function:    Function used to calculate waving (0 .. 2)
  274.  
  275.  
  276. You can change the rotation speed of object with these parameters:
  277.  
  278. rot_x :      rotation increment around x axis
  279. rot_y :      " " y axis
  280. rot_z :      " " z axis
  281.  
  282.  
  283. You can optionally enable a child object with "child_type" parameter:
  284.  
  285. child_type :
  286.  
  287.  0  Off
  288.  1  Toroids
  289.  2  Stretching spheres   (require sphere01.class)
  290.  3  Cones                (require cone01.class)
  291.  
  292. Like main object, we have:
  293.  
  294. child_render:  render technique (0 .. 14)
  295. child_texture: texture for child object (0 = texture0, 1 = texture1 etc.)
  296.  
  297.  
  298. You can optionally enable projected shadow, but then the render will be
  299. forced to use plain texture mapping. The parameter is "shadow":
  300.  
  301. shadow :
  302.  
  303.  0  No projected shadows
  304.  1  Hires projected shadows  ** Note: render forced to mode "0": Plain texture
  305.  2  Lores projected shadows  ** Note: render forced to mode "0": Plain texture
  306.  
  307.  
  308. You can enable a mirror on left side, that will reflect the scene, using the
  309. "mirror" parameter:
  310.  
  311. mirror :
  312.  
  313.  0  no mirror
  314.  1  mirror      (require box01.class)
  315.  
  316. Note: If shadow and mirror are enabled altogether, the mirror will not work as
  317. mirror, but displayed as a box.
  318.  
  319.  
  320. Another option is "lightballs". If you set it to "0", any lightball will be
  321. displayed. But, placing a value from "1" to "6", the flying lightballs
  322. will appear.
  323.  
  324. If lightballs are enabled, the "phongmap" is required, even if no phong
  325. shading render is used.
  326.  
  327.  
  328. -----------------------
  329. - SCRIPT 1: LABYRINTH -
  330. -----------------------
  331.  
  332. In the labyrinth, the main object is a floor and the child object is 
  333. a wall, and you can't modify them (main_type and child_type are disabled).
  334. Instead, you can choose the rendering technique and texture:
  335.  
  336. main_render:  render technique (0 .. 14)
  337. main_texture: texture for main object (0 = texture0, 1 = texture1 etc.)
  338.  
  339. child_render:  render technique (0 .. 14)
  340. child_texture: texture for child object (0 = texture0, 1 = texture1 etc.)
  341.  
  342. Note: Not all the rendering techniques work well on this script.
  343.  
  344.  
  345. For a metallic lightning effect, set the "animlight" effect to "YES", and the
  346. lightsource will be moved continously.
  347.  
  348.  
  349. [Background]
  350.  
  351. <param name=back_type value="1">         ; Background type (0 .. 2)
  352. <param name=back_render value="7">       ; Background render (0 .. 14)
  353. <param name=back_texture value="2">      ; Background texture (0 .. 2)
  354. <param name=back_r value="50">           ; Background color red component
  355. <param name=back_g value="30">           ; Background color green component
  356. <param name=back_b value="0">            ; Background color blue component
  357.  
  358. Regarding background, you can disable it (black colour) placing a value of "0"
  359. in "back_type" parameter. This is useful only if you want to enable motion 
  360. blur effect or if you need a black background. Otherwise, setting it to "1" 
  361. and enable the background, including the scene into a big sphere, that become
  362.  the background.
  363.  
  364. If you like to have a custom uniform colour as background, set "back_type" to
  365. the value "2", and then set the desired colour with the "back_r", "back_g",
  366. "back_b" parameters, specifying the Red, Green, Blue components (0 .. 255).
  367.  
  368. If you have set "back_type" to "1", you must choose the render technique used
  369. in background object, and the relative texture to use.
  370.  
  371. To choose the render technique, set the "back_render" parameter with a render 
  372. type number. Here is the list of available rendering techniques:
  373.  
  374.  0  Plain texture
  375.  1  Gouraud shading
  376.  2  Phong shading          ** NOTE: "phongmap" must be loaded
  377.  3  Gaussian phong shading ** NOTE: "gaussmap" must be loaded
  378.  4  Transparent (light)
  379.  5  Transparent (medium)
  380.  6  Liquid texture
  381.  7  Liquid gouraud shading
  382.  8  Liquid phong shading    ** NOTE: "phongmap" must be loaded
  383.  9  Liquid transparent
  384.  10 Reflects mirror view    ** NOTE: texture is ignored, a mirror must exists
  385.  11 Particles               ** NOTE: texture is ignored
  386.  12 Darker plain texture
  387.  13 Metal shading           ** NOTE: "phongmap" must be loaded
  388.  14 Environment mapping
  389.  
  390. Gouraud, Phong and Gaussian Phong are 3 ways to calculate the shading on
  391. objects.
  392.  
  393. Liquid modes are like normal modes, except the fact that the texture is waving
  394. like a liquid one.
  395.  
  396. The mode 10 is usable only with script=0, and mirror=1, in fact, it maps on the
  397. object what is "seen and reflected" by the mirror.
  398.  
  399. All the rendering techniques require textures, except mode 10 and 11.
  400.  
  401. To specify the texture, use "back_texture" parameter, choosing a a number
  402. from 0 to 2. These numbers correspond to the textures loaded with "texture0",
  403. "texture1" and "texture2" parameters.
  404.  
  405. [Fog effect]
  406.  
  407. <param name="fog" value="0">               ; Fog (0 .. 1)
  408. <param name="fog_near" value="300">        ; Fog distance start (0 .. 1000)
  409. <param name="fog_far" value="340">         ; Fog distance stop (0 .. 1000)
  410.  
  411. Only the objects that use Gouraud shading can be fogged. To enable fog, 
  412. set the "fog" parameter to "1". The value "0" disables fog.
  413.  
  414. The fog intensity can be changed using "fog_near" and "fog_far" parameters. 
  415. The former decides when the fog effect starts, while the latter controls 
  416. the diminishing point of the fog. Values for both represent length from
  417. the camera to fog start point or end point.
  418.  
  419. NOTE:
  420.  
  421. fog_near < fog_far.
  422.  
  423. [Motion blur effect]
  424.  
  425. <param name="blur_motion" value="0">       ; Motion blur (0 .. 1)
  426.  
  427. You can optionally enable a motion blur effect; just set "blur_motion"
  428. parameter to "1". Use "0" to disable it.
  429.  
  430. NOTE: 
  431.  
  432. There will be blur_motion ONLY if background is disabled, in other
  433. words, if "back_type" parameter is set to value "0".
  434.  
  435. [Overlay image]
  436.  
  437. <param name="overimg" value="NO">           ; Optional image over applet
  438. <param name="overimgX" value="0">           ; Over image X offset
  439. <param name="overimgY" value="0">           ; Over image Y offset
  440.  
  441.  
  442. With the "overimg" parameter you can specify the name of an image that will
  443. be shown over the applet. The best options are transparent GIF images.
  444.  
  445. NOTE: Animated GIF images are supported, but will be displayed as animated
  446. only on latest browsers (Netscape 4 and Explorer 4 or newer).
  447. With "overimgX" and "overimgY" you can position the image over the applet area.
  448.  
  449.